package src.stu23002132.chapter07;

import java.util.Iterator;
import java.util.LinkedHashSet;

public class demo10 {
    public static void main(String[] args) {
        LinkedHashSet hset_23002132 = new LinkedHashSet();
        hset_23002132.add("张三");                   // 向该Set集合中添加字符串
        hset_23002132.add("李四");
        hset_23002132.add("王五");
        Iterator it = hset_23002132.iterator();  // 获取Iterator对象
        while (it.hasNext()){           // 通过while循环，判断集合中是否有元素
            Object obj = it.next();
            System.out.println(obj);
        }
    }
}
